class Node{
    constructor(value, next = null, prev = null) {
        this.value = value;
        this.next = next; //后继指针
        this.prev = prev; //前继指针
    }
}

let a = new Node(1);
let b = new Node(2);
let c = new Node(3);


a.next = b; //a的后继指针指向b
b.prev = a; //b的前继指针指向a
b.next = c; //b的后继指针指向c
c.prev = b; //c的前继指针指向b

console.log(a);

console.log(b.prev === a); //可以用过b的前继指针找到a
console.log(c.prev === b); //可以用过c的前继指针找到b

